package com.helu.lubike.activity;

import android.content.pm.PackageManager;
import android.databinding.DataBindingUtil;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.helu.lubike.R;
import com.helu.lubike.databinding.ActivityAboutBinding;

/**
 * 关于
 * Created by helu on 17-2-10.
 */

public class AboutActivity extends AppCompatActivity {

    private ActivityAboutBinding mInflate;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mInflate = DataBindingUtil.inflate(getLayoutInflater(), R.layout.activity_about, null, false);
        setContentView(mInflate.getRoot());

        initView();
        initListener();
        initData();
    }

    private void initData() {

    }

    private void initListener() {
        mInflate.back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }

    private void initView() {
        String pkName = this.getPackageName();
        try {
            String versionName = this.getPackageManager().getPackageInfo(pkName, 0).versionName;
            mInflate.versionCode.setText(versionName);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
    }
}
